<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>板块管理--编程之友BBS</title>
    <link rel="stylesheet" type="text/css" href="style/top.css" />
    <link rel="stylesheet" type="text/css" href="style/main.css" />
    <link rel="stylesheet" type="text/css" href="style/footer.css" />
    <link rel="stylesheet" type="text/css" href="style/reglog.css" />
    <link rel="stylesheet" type="text/css" href="style/manage.css" />
  </head>
  <script type="text/javascript">
  	function deletetips(id){
  		if(confirm("删除板块将会删除其所属的所有帖子及回帖，确认要删除吗？")){
  			window.location = "blocks.jspx?_method=delete&id=" + id;
  		}
  	}
  </script>
  
  <body>
    <!-- 网页头部 -->
     <!-- head开始 -->
	<div id="hd">
    	<div class="wp">
        	<div class="hdc">
            	<div class="hd_bg_x">
                	<div id="hd_rt">
                        <span class="e_topmenu">
                        </span>
                        <h2>
                            <a href="index.jspx" title="编程之友BBS"></a>
                        </h2>
                        <div id="e_nv">
                            <div class="new_topbar">
                                <span class="new_topbar_left">
                                <c:choose>
                                	<c:when test="${not empty user}">
                                欢迎您！ ${user.username } <a href="user.jspx?_method=quit">[安全退出]</a>
                                	</c:when>
                                	<c:when test="${not empty manager}">
                                欢迎您！管理员： ${manager.username } <a href="user.jspx?_method=quit">[安全退出]</a>    
                                <a href="user.jspx?_method=showusers" class="user">用户管理</a>
                                    <span class="pipe" style="margin: 0 5px;"> | </span>
                                    <a href="blocks.jspx?_method=manageblocks" class="blocks">板块管理</a>                      
                                    </c:when>
                                    
                                    <c:otherwise>
                                    
                                    </c:otherwise>
                                </c:choose>
                                </span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
		
   	<!-- 中间部分 -->
   	<div class="main">
   	
   	<c:forEach var="b" items="${sessionScope.blockslist}">
		<div class="blockslist">
			<table width="985">
				<h2>${b.name }</h2>
				<tr>
					<th>版块名称</th>
					<th>版块简介</th>
					<th>帖子数</th>
					<th>版主</th>
					<th>操作</th>
				</tr>
				<c:forEach var="bb" items="${b.blocksList}">
				<tr>
					<td>${bb.name }</td>
					<td>${bb.content }</td>
					<td>${bb.articleNum}</td>
					<td><c:forEach var="m" items="${bb.mlist }">${m.user.username } </c:forEach></td>
					<td><a href="blocks.jspx?_method=delete&id=${bb.id }">删除板块</a></td>
				</tr>
				</c:forEach>
			</table>
		</div>
	</c:forEach>
    </div>
    
    
      <!-- 网页底部 -->
    <%@include file="../template/footer.jsp" %>
  </body>
</html>
